<script setup>
import {ref,onMounted} from 'vue'

import {RoleApi} from '@/api/role'

const props =  defineProps({
  roleIds: {
    type: Array,
    default: () => []
  }
})


const roles = ref([])

const rolesData = ref([

])

onMounted(()=>{
  RoleApi.list().then(res=>{
    console.log("res的数据",res)
    rolesData.value = res.data
  })
})


</script>

<template>
  <el-select multiple v-model="roles" placeholder="请选择角色">
    <el-option v-for="item in rolesData" :key="item.id" :label="item.name" :value="item.id"></el-option>
  </el-select>
</template>

<style scoped>

</style>